package com.thghh.ch3.list;

/**
 * @author Zhikang.Peng
 * @version 1.0
 * @email thghh@qq.com
 * @date 2020/8/20 11:17
 */
public interface List<T> {
    /**
     * Remove all objects from list
     */
    void clear();

    /**
     * Insert object at current position
     * @param item
     */
    void insert(T item);

    /**
     * insert object at tail of list
     * @param item
     */
    void append(T item);

    /**
     * Move current/return current object
     * @return
     */
    T remove();

    /**
     * Set current to first position
     */
    void setFirst();

    /**
     * Move current to first position
     */
    void next();

    /**
     * Move current to previous position
     */
    void previous();

    /**
     * Return current length of list
     * @return
     */
    int length();

    /**
     * Set current to specified position
     * @param position
     */
    void setPosition(int position);

    /**
     * set current object's value
     * @param val
     */
    void setValue(T val);

    /**
     * Return value of current Object
     * @return
     */
    T currentValue();

    /**
     * Return true if list is empty, else return false
     * @return
     */
    boolean isEmpty();

    /**
     * Turn is current is within list
     * @return
     */
    boolean indexOf();

    /**
     * Print all of list's element
     */
    void print();
}
